class CreateGames < ActiveRecord::Migration
  def self.up
    create_table :games do |t|
      t.integer "user_id", :null => false
      t.string "deck"
      t.string "table"
      t.string "gamer"
      t.string "opponent"
      t.string "trump", :null => false
      t.boolean "user_is_attacking", :default => true
      t.string "state", :limit => 10, :default => ''
      t.integer "final_status",  :default => -1
      t.timestamps
    end
     add_index(:games, "user_id")   #primary keys
  end

  def self.down
    drop_table :games
  end
end
